home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Include / classobject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  2.8 KB  |  83 lines  |  [TEXT/R*ch]

  1. #ifndef Py_CLASSOBJECT_H
  2. #define Py_CLASSOBJECT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /***********************************************************
  8. Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  9. The Netherlands.
  10.  
  11.                         All Rights Reserved
  12.  
  13. Permission to use, copy, modify, and distribute this software and its 
  14. documentation for any purpose and without fee is hereby granted, 
  15. provided that the above copyright notice appear in all copies and that
  16. both that copyright notice and this permission notice appear in 
  17. supporting documentation, and that the names of Stichting Mathematisch
  18. Centrum or CWI not be used in advertising or publicity pertaining to
  19. distribution of the software without specific, written prior permission.
  20.  
  21. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
  22. THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  23. FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
  24. FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  25. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  26. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  27. OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  28.  
  29. ******************************************************************/
  30.  
  31. /* Class object interface */
  32.  
  33. #ifdef WITH_THREAD
  34. #include "thread.h"
  35. #else
  36. #define get_thread_ident() 1L
  37. #endif
  38.  
  39. /* Revealing some structures (not for general use) */
  40.  
  41. typedef struct {
  42.     PyObject_HEAD
  43.     PyObject    *cl_bases;    /* A tuple of class objects */
  44.     PyObject    *cl_dict;    /* A dictionary */
  45.     PyObject    *cl_name;    /* A string */
  46.     /* The following three are functions or NULL */
  47.     PyObject    *cl_getattr;
  48.     PyObject    *cl_setattr;
  49.     PyObject    *cl_delattr;
  50. } PyClassObject;
  51.  
  52. typedef struct {
  53.     PyObject_HEAD
  54.     PyClassObject    *in_class;    /* The class object */
  55.     PyObject    *in_dict;    /* A dictionary */
  56. } PyInstanceObject;
  57.  
  58. extern DL_IMPORT(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type;
  59.  
  60. #define PyClass_Check(op) ((op)->ob_type == &PyClass_Type)
  61. #define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type)
  62. #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
  63.  
  64. extern PyObject *PyClass_New Py_PROTO((PyObject *, PyObject *, PyObject *));
  65. extern PyObject *PyInstance_New Py_PROTO((PyObject *, PyObject *, PyObject *));
  66. extern PyObject *PyMethod_New Py_PROTO((PyObject *, PyObject *, PyObject *));
  67.  
  68. extern PyObject *PyMethod_Function Py_PROTO((PyObject *));
  69. extern PyObject *PyMethod_Self Py_PROTO((PyObject *));
  70. extern PyObject *PyMethod_Class Py_PROTO((PyObject *));
  71.  
  72. extern int PyClass_IsSubclass Py_PROTO((PyObject *, PyObject *));
  73.  
  74. extern PyObject *PyInstance_DoBinOp
  75.     Py_PROTO((PyObject *, PyObject *,
  76.           char *, char *,
  77.           PyObject * (*) Py_PROTO((PyObject *, PyObject *)) ));
  78.  
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* !Py_CLASSOBJECT_H */
  83.